package com.chwn.curiousdiary.bean;

import android.text.TextUtils;

import com.chwn.harulib.util.TimeUtils;
import com.orhanobut.logger.Logger;

import java.io.Serializable;

/**
 * Created by Myshikin on 2017/4/11.
 * ---故事包id	storyPackageId	string
 * ---故事包名字	storyPackageTitle	string
 * ---故事包介绍	storyPackageDetailTitle	string
 * ---故事包封面	storyPackageImage	string
 */
public class StoryListBean implements Serializable {

    private int sParts;
    private int downState;

    public int getsParts() {
        return sParts;
    }

    public void setsParts(int sParts) {
        this.sParts = sParts;
    }

    private String storyId;

    private String storyTitle;

    private String storyDetailTitle;

    private String storyImage;

    private String storyUrl;

    private String stroyShareURL;

    private String storyListenCount;

    private String storyCreateTime;

    private String storyPackageCount;

    public String getStoryListenCount() {
        return storyListenCount;
    }

    public void setStoryListenCount(String storyListenCount) {
        this.storyListenCount = storyListenCount;
    }

    public String getStoryListenCountString() {
        String count = storyListenCount;
        try {
            if (Integer.parseInt(storyListenCount) > 10000) {
                count = Integer.parseInt(storyListenCount) / 10000 + "." + (Integer.parseInt(storyListenCount) % 10000) / 1000 + "万";

            }  else {
                count = storyListenCount;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }

        return count;
    }

    public String getStoryPackageCount() {
        return storyPackageCount;
    }

    public void setStoryPackageCount(String storyPackageCount) {
        this.storyPackageCount = storyPackageCount;
    }


    public String getStoryCreateTime() {

        return this.storyCreateTime;
    }

    //  对时间戳处理
    public String getStoryCreateTimeString() {
        if (TextUtils.isEmpty(storyCreateTime) || "未知".equals(storyCreateTime)) {
            return "未知";
        }
        return TimeUtils.getUpdateTime(storyCreateTime);
    }

    public void setStoryCreateTime(String storyCreateTime) {
        this.storyCreateTime = storyCreateTime;
    }


    private int stroyPraiseCount;

    public String getStoryTags() {
        return storyTags;
    }

    public void setStoryTags(String storyTags) {
        this.storyTags = storyTags;
    }

    private String storyTags;

    /**
     * 0--未收藏  1--已收藏
     */
    private int stroyCollectionState;

    /**
     * 0--未点赞  1--已点赞
     */
    private int storyPraiseState;

    /**
     * 故事类型
     */
    private String typeName;

    /**
     * 故事类型ID
     */
    private String typeId;

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public String getTypeId() {
        return typeId;
    }

    public void setTypeId(String typeId) {
        this.typeId = typeId;
    }

    public String getStoryId() {
        return storyId;
    }

    public void setStoryId(String storyId) {
        this.storyId = storyId;
    }

    public String getStoryTitle() {
        return storyTitle;
    }

    public void setStoryTitle(String storyTitle) {
        this.storyTitle = storyTitle;
    }

    public String getStoryDetailTitle() {
        return storyDetailTitle;
    }

    public void setStoryDetailTitle(String storyDetailTitle) {
        this.storyDetailTitle = storyDetailTitle;
    }

    public String getStoryImage() {
        return storyImage;
    }

    public void setStoryImage(String storyImage) {
        this.storyImage = storyImage;
    }

    public String getStoryUrl() {
        return storyUrl;
    }

    public void setStoryUrl(String storyUrl) {
        this.storyUrl = storyUrl;
    }

    public String getStroyShareURL() {
        return stroyShareURL;
    }

    public void setStroyShareURL(String stroyShareURL) {
        this.stroyShareURL = stroyShareURL;
    }

    public int getStroyPraiseCount() {
        return stroyPraiseCount;
    }

    public void setStroyPraiseCount(int stroyPraiseCount) {
        this.stroyPraiseCount = stroyPraiseCount;
    }

    public int getStroyCollectionState() {
        return stroyCollectionState;
    }

    public void setStroyCollectionState(int stroyCollectionState) {
        this.stroyCollectionState = stroyCollectionState;
    }

    public int getStoryPraiseState() {
        return storyPraiseState;
    }

    public void setStoryPraiseState(int storyPraiseState) {
        this.storyPraiseState = storyPraiseState;
    }

    private String storyPackageId;

    private String storyPackageTitle;

    private String storyPackageDetailTitle;

    private String storyPackageImage;

    public StoryListBean(String storyPackageTitle, String storyPackageDetailTitle, String storyPackageImage, String storyPackageId) {
        this.storyPackageDetailTitle = storyPackageDetailTitle;
        this.storyPackageTitle = storyPackageTitle;
        this.storyPackageId = storyPackageId;
        this.storyPackageImage = storyPackageImage;
    }

    public StoryListBean(StoryBean bean) {
        this.storyId = bean.getStoryId();
        this.storyTitle = bean.getStoryTitle();
        this.storyDetailTitle = bean.getStoryDetailTitle();
        this.storyImage = bean.getStoryImage();
        this.storyUrl = bean.getStoryUrl();
        this.stroyShareURL = bean.getStroyShareURL();
        this.stroyPraiseCount = bean.getStroyPraiseCount();
        this.stroyCollectionState = bean.getStroyCollectionState();
        this.storyPraiseState = bean.getStoryPraiseState();
        this.typeName = bean.getTypeName();
        this.typeId = bean.getTypeId();
        this.storyCreateTime = bean.getStoryCreateTime();
        this.storyListenCount = bean.getStoryListenCount();
    }

    @Override
    public String toString() {
        return "StoryListBean{" +
                "storyPackageId='" + storyPackageId + '\'' +
                ", storyPackageTitle='" + storyPackageTitle + '\'' +
                ", storyPackageDetailTitle='" + storyPackageDetailTitle + '\'' +
                ", storyPackageImage='" + storyPackageImage + '\'' +
                '}';
    }

    public String getStoryPackageId() {
        return storyPackageId;
    }

    public void setStoryPackageId(String storyPackageId) {
        this.storyPackageId = storyPackageId;
    }

    public String getStoryPackageTitle() {
        return storyPackageTitle;
    }

    public void setStoryPackageTitle(String storyPackageTitle) {
        this.storyPackageTitle = storyPackageTitle;
    }

    public String getStoryPackageDetailTitle() {
        return storyPackageDetailTitle;
    }

    public void setStoryPackageDetailTitle(String storyPackageDetailTitle) {
        this.storyPackageDetailTitle = storyPackageDetailTitle;
    }

    public String getStoryPackageImage() {
        return storyPackageImage;
    }

    public void setStoryPackageImage(String storyPackageImage) {
        this.storyPackageImage = storyPackageImage;
    }

    public int getDownState() {
        return downState;
    }

    public void setDownState(int downState) {
        this.downState = downState;
    }
}
